﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using MS.InformationManagement.ContentHub.ObjectDef.WebControls;
using Microsoft.SharePoint.WebControls;

namespace MS.InformationManagement.ContentHub.ObjectDef.CustomFields
{
    public class DeliveryTraceabilityField : SPFieldMultiColumn
    {
        public DeliveryTraceabilityField(SPFieldCollection fields, string fieldName)
            : base(fields, fieldName){ }

        public DeliveryTraceabilityField(SPFieldCollection fields, string typeName, string displayName)
            : base(fields, typeName, displayName) { }

        public override BaseFieldControl FieldRenderingControl
        {
            get
            {
                BaseFieldControl fieldControl = new DeliveryTraceabiltyFieldControl();
                fieldControl.FieldName = InternalName;
                return fieldControl;
            }
        }

        public override object GetFieldValue(string value)
        {
            if (string.IsNullOrEmpty(value))
                return null;
            return new DeliveryTraceabilityFieldValue(value);
        }
    }
}
